package com.youyi.yyviewsdklibrary;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.ImageView;
import android.widget.TextView;

import com.lkx.liandianqinew.R;

public class BaseLoadDialog extends Dialog {
    private static TextView mTextView;

    public BaseLoadDialog(Context context) {
        super(context, R.style.LoadDialogStyle);
        setContentView(R.layout._yy_loading_dialog);
        mTextView = (TextView) findViewById(R.id.id_text);
    }

    public static void setTextViewNull() {
        mTextView = null;
    }

    public static void SetText(String str) {
        mTextView.setVisibility(View.VISIBLE);
        mTextView.setText(str);
    }

    public static void ShowText() {
        mTextView.setVisibility(View.VISIBLE);
    }

    private void Rotate(ImageView imageView) {
        RotateAnimation rotateAnimation = new RotateAnimation(0.0f, -360.0f, 1, 0.5f, 1, 0.5f);
        rotateAnimation.setDuration(1000);
        rotateAnimation.setInterpolator(new LinearInterpolator());
        rotateAnimation.setRepeatCount(-1);
        imageView.startAnimation(rotateAnimation);
    }
}
